<?php

/*
*
* BEGIN ajaxhandler.php
*
*
* Dazzler Server Client Communication Interface - Ajax Handler
* @Description: handles AJAX calls for site and routes them to the ajax controller
* @Authors: Salman Noor, Wits University
* @Copyright: © Wits University 2011 - All Rights Reserved
* @License: BSD License (http://www.linfo.org/bsdlicense.html)
*
*
* BEGIN CHANGELOG
* Developers working on thee files are REQUIRED to maintain this CHANGELOG.
* Please ensure you follow the Changelog Guidelines: http://code.google.com/p/dazzler/wiki/DazzlerDevelopGuideline?ts=1315476570&updated=DazzlerDevelopGuideline
* !==================================================================================================================================================================
*
* VERSION 1.0.0
*	+ File Created, Salman, 14 September 2011
*
* ==================================================================================================================================================================!
* END CHANGELOG
*/


/*******************************************************************************************************************************************************************
*
* BEGIN Direct Call Check
*
/******************************************************************************************************************************************************************/
global $doNotCallThisScriptDirectly;
if ($doNotCallThisScriptDirectly != 1)
{
	/* Read the ini language file */
	$ini_lang_array = array();
	$clientlang = explode(",", strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']));
	$lang_ini_array = (file_exists("lang/" . trim($clientlang[0]) . ".ini")) ? parse_ini_file("lang/" . trim($clientlang[0]) . ".ini", true) : parse_ini_file("lang/en.ini", true);
	die ($lang_ini_array['ERRORS']['doNotCallThisScriptDirectly']);
}


$userAdmin = new UserAdmin();
      echo $userName =  $userAdmin->isUsernameSet();
      $userDetails = $userAdmin->getCommentatorDetails($userName);
      echo $userDetails['USER_FNAME'].$userDetails['USER_LNAME'];
if ($userAdmin->isLoggedOn() && $userAdmin->isUserCommentator())
{
    echo "yes";
}

//if ($_SESSION['logged'] != "1" && $_SESSION['admin_level'] != "1")
//{
//    die ($lang_ini_array['ERRORS']['UserLevelPageError']);
//}
//
//            echo $_SESSION['username'];
//            echo $_SESSION['logged'];
//            echo $_SESSION['admin_level'];
/*******************************************************************************************************************************************************************
*
* END Direct Call Check
*
/******************************************************************************************************************************************************************/

/*******************************************************************************************************************************************************************
* BEGIN Marshall request types {POST, GET} but only POST are handled
/******************************************************************************************************************************************************************/

//$cm = new fetchpathitems($path . "/sites/dazzler/themes/$loadType/custom/styles/commentator/", "css");
//
//	foreach($cm->cm as $includeCssFile)
//	{
//	//echo$includeCssFile;
//
//            $css_head .= "<link rel='stylesheet' type='text/css' href='$rootpath/themes/$loadType/custom/styles/commentator/$includeCssFile' />";
//	}
//include $path . "/sites/dazzler/themes/$loadType/templates/main.php";
?>

